/*StcEeprom*/
#include "Stc89c52Eeprom.h"
void Stc89c52EepromEraseSector(unsigned int address)
{
	ISP_CONTR=0x81;
	ISP_CMD=0x03;
	ISP_ADDRL=address;
	ISP_ADDRH=address>>8;
	EA=0;
	ISP_TRIG=0x46;
	ISP_TRIG=0xb9;
	_nop_();
	Stc89c52QuitISP();
}
void Stc89c52EepromWrite(unsigned int address,unsigned char dat)
{
	ISP_CONTR=0x81;
	ISP_CMD=0x02;
	ISP_ADDRL=address;
	ISP_ADDRH=address>>8;
	ISP_DATA=dat;
	EA=0;
	ISP_TRIG=0x46;
	ISP_TRIG=0xb9;
	_nop_();
	Stc89c52QuitISP();
}
unsigned char Stc89c52EepromRead(unsigned int address)
{
	unsigned char dat;
	ISP_CONTR=0x81;
	ISP_CMD=0x01;
	ISP_ADDRL=address;
	ISP_ADDRH=address>>8;
	EA=0;
	ISP_TRIG=0x46;
	ISP_TRIG=0xb9;
	_nop_();
	dat=ISP_DATA;
	Stc89c52QuitISP();
	return dat;
}
void Stc89c52QuitISP()
{
	EA=1;
	ISP_CONTR=0;
	ISP_CMD=0;
	ISP_TRIG=0;
}
